<template>
  <CloudPagination :total="500" :item-render="itemRender" :current="current" @change="changePage" />
</template>
<script>
export default {
  title: '10.上一页和下一页',
  data() {
    return {
      current: 1
    }
  },
  methods: {
    itemRender(current, type, originalElement) {
      if (type === 'prev') {
        return <a>上一页</a>;
      } else if (type === 'next') {
        return <a>下一页</a>;
      }
      return originalElement;
    },
    changePage(pageNumber) {
      console.log('Page: ', pageNumber);
      this.current = pageNumber
    },
  },
};
</script>